package com.xiaoran.spring.controller;

import com.xiaoran.spring.domain.CommResult;
import com.xiaoran.spring.service.AccountService;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.math.BigDecimal;

@RestController
public class AccountController {

    @Resource
    private AccountService accountService;

    @RequestMapping("/account/deleter")
    public CommResult delete(@RequestParam("user_id") Long user_id, @RequestParam("money") BigDecimal money){
        accountService.delete(user_id,money);
        return new CommResult(200,"扣减账户余额成功！");
    }

}
